<?
 
 class Controller_Confirmation
  extends Controller_Base{

 	function index($args) {

		$template = new Template('confirmation.tmpl');
 		
// 		if($_GET[action]==='activate') {
			


	 		$sigs = array(
	 			'code'	=> array('type' => 'string','function'=>array('htmlspecialchars'),'required' =>1),
			);			
				
			sanitize_vars($_GET,$sigs,null);						

			try {
				$user = new Model_User();
				$result = $user->confirmEmail($_GET[code]);
			} catch( UserException $e ) {
				$template->setArg(confirmation_error,$e->getMessage());
			} 

			if($result) {
				// login
				$template->setArg(show_success_message,1);
			}


// 		} 
 		
		return array(
			status 		=> 0,
			template	=> $template
		); 		
 	}
 }
 
?>